package AtomThreadDemo;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomThread implements Runnable{
    private int count = 0;// 表示冰淇淋的数量
    AtomicInteger ac = new AtomicInteger(0);


    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            // count++;
            int count = ac.incrementAndGet();
            System.out.println("已经送了"+count+"个");
        }
    }
}
